/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package uit.ieproject.business;

import java.sql.SQLException;
import java.util.ArrayList;
import uit.ieproject.dataaccess.RegexDAO;
import uit.ieproject.entities.Regex;

/**
 *
 * @author Maivia
 */
public class RegexBLO {

    private RegexDAO regexDAO = new RegexDAO();

    public ArrayList<Regex> getAllRegexs() throws SQLException {
        return regexDAO.getAllRegexs();
    }

    public void addRegex(Regex regex) throws SQLException {
        regexDAO.addRegex(regex);
    }

    public void deleteRegex(long[] id) throws SQLException {
        regexDAO.deleteRegex(id);
    }

    public void editRegex(Regex regex) throws SQLException {
        regexDAO.editRegex(regex);
    }

    public ArrayList<Regex> getRegex(String name, String type, int status) throws SQLException {
        return regexDAO.getRegex(name, type, status);
    }

    public String getAnswer(String person, String info) throws SQLException {
        return regexDAO.getAnswer(person, info);
    }
    
    public void activeRegexs(long[] ids, int isActive) throws SQLException{
        regexDAO.activeRegexs(ids, isActive);
    }
}
